# build in python 3.5.2
# 作者：陈常鸿
# 伯努利分布
import numpy as np
def bornulli(p):
    return 1 if np.random.rand() > p else 0